@echo Deploying CKSEWE solution

@set PATH=C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN;%PATH%

@if "%1"=="" (goto invalidParameters) 

stsadm -o deactivatefeature -name CKSEWEContent -url %1 -force
stsadm -o deactivatefeature -name CKSEWEFields -url %1 -force
stsadm -o deactivatefeature -name CKSEWELibrary -url %1 -force
stsadm -o deactivatefeature -name CKSWikiDiscussionsList -url %1 -force
pause
stsadm -o uninstallfeature -name CKSEWEContent -force
stsadm -o uninstallfeature -name CKSEWEFields -force
stsadm -o uninstallfeature -name CKSEWELibrary -force
stsadm -o uninstallfeature -name CKSWikiDiscussionsList -force
pause
stsadm -o retractsolution -name CKSEWE.wsp -immediate -url %1
stsadm -o execadmsvcjobs
stsadm -o deletesolution -name CKSEWE.wsp -override
pause
stsadm -o addsolution -filename Package\CKSEWE.wsp
stsadm -o deploysolution -name CKSEWE.wsp -immediate -allowgacdeployment -force -url %1
stsadm -o execadmsvcjobs
pause
stsadm -o installfeature -name CKSEWEContent -force
stsadm -o installfeature -name CKSEWEFields -force
stsadm -o installfeature -name CKSEWELibrary -force
stsadm -o installfeature -name CKSWikiDiscussionsList -force
pause
stsadm -o activatefeature -name CKSEWEContent -url %1
stsadm -o activatefeature -name CKSEWEFields -url %1
stsadm -o activatefeature -name CKSEWELibrary -url %1
stsadm -o activatefeature -name CKSWikiDiscussionsList -url %1

@goto endOfBatch

:invalidParameters
	@echo Please call with the correct parameters.
	@echo The correct syntax of this command is:
	@echo Deploy [siteurl]	

:endOfBatch

pause